<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="/views/commons/taglibs.jsp" %>
<c:choose>
<c:when test="${paramMap.type==1}">
	<div class="panel-heading">
		<h3 class="panel-title">已获取的角色列表</h3>
	</div>
	<div class="bd clearfix">
		<form id="user_role_has_form" action="javascript:void(0);">
			<input type="hidden" name="type" id="list_type" value="${paramMap.type}">
			<div class="filter-wrap">
				<dl class="clearfix invest-filter">
					<dt>角色名称</dt>
					<dd class="clearfix">
						<div class="col-sm-8 mb20">
							<div class="input-group">
								<input type="text" name="roleName" value="${paramMap.roleName}" class="form-control" placeholder="请输入角色名称">
								<span class="input-group-btn">
									<button class="btn btn-primary" type="button" onclick="javascript:queryUserRoleList_has(1);">搜索</button>
								</span>
							</div>
						</div>
					</dd>
				</dl>
			</div>
		</form>
	</div>
</c:when>
<c:otherwise>
	<div class="panel-heading">
		<h3 class="panel-title">未获取的角色列表</h3>
	</div>
	<div class="bd clearfix">
		<form id="user_role_not_own_form" action="javascript:void(0);">
			<input type="hidden" name="type" id="list_type" value="${paramMap.type}">
			<div class="filter-wrap">
				<dl class="clearfix invest-filter">
					<dt>角色名称</dt>
					<dd class="clearfix">
						<div class="col-sm-8 mb20">
							<div class="input-group">
								<input type="text" name="roleName" value="${paramMap.roleName}" class="form-control" placeholder="请输入角色名称">
								<span class="input-group-btn">
									<button class="btn btn-primary" type="button" onclick="javascript:queryUserRoleList_not_own(1);">搜索</button>
								</span>
							</div>
						</div>
					</dd>
				</dl>
			</div>
		</form>
	</div>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty dataList && fn:length(dataList) ne 0}">
<table class="table">
	<thead>
		<tr>
			<th width="40%">角色名称</th>
			<th width="60%">操作</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="role" items="${dataList}" varStatus="index">
		<tr>
			<td class="title">${role.roleName}</td>
			
			<td>
				<c:choose>
				<c:when test="${paramMap.type==1}">
					<a href="javascript:deleteUserRole('${role.roleId}')">收回角色</a>
				</c:when>
				<c:otherwise>
					<a href="javascript:addUserRole('${role.roleId}')">分配角色</a>
				</c:otherwise>
				</c:choose>
			</td>
		</tr>
		</c:forEach>
	</tbody>
</table>
<!-- 分页 -->
<c:choose>
<c:when test="${paramMap.type==1}">
	<p:pagination pageNo="${paramMap.pageNo}" pageCount="${paramMap.pageCount}" queryFunction="queryUserRoleList_has" style="text-center"></p:pagination>
</c:when>
<c:otherwise>
	<p:pagination pageNo="${paramMap.pageNo}" pageCount="${paramMap.pageCount}" queryFunction="queryUserRoleList_not_own" style="text-center"></p:pagination>
</c:otherwise>
</c:choose>

<!-- 分页 end -->
</c:when>
<c:otherwise>
	<table class="table">
		<thead>
			<tr>
				<th width="40%">角色名称</th>
				<th width="60%">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td colspan="2" align="center">
					暂无数据
				</td>
			</tr>
		</tbody>
	</table>
</c:otherwise>
</c:choose>